//
//  MCHomeTitleBtn.swift
//  HXWeibo
//
//  Created by HX on 15/11/29.
//  Copyright © 2015年 HX. All rights reserved.
//

import UIKit

class MCHomeTitleBtn: UIButton
{
    required init?(coder aDecoder: NSCoder)
    {
        fatalError("init(coder:) has not been implemented")
    }
    
    init(title: String)
    {
        super.init(frame: CGRectZero)
        
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        
        setTitle(title, forState: UIControlState.Normal)
        
        setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        
        sizeToFit()
    }

    // 系统调用
    override func layoutSubviews()
    {
        super.layoutSubviews()
        
        //调整标题按钮 标题和图片的位置
        titleLabel?.frame.origin.x = 0
        
        imageView?.frame.origin.x = titleLabel!.frame.size.width + 3
    }
}


































